package com.neusoft.bizcore.activiti.enums;

import java.util.Arrays;
import java.util.List;

public enum OperationTypeEnum implements IDictionary {
    add(1, "增加"),
    update(2, "修改"),
    delete(3, "删除");

    private int value;
    private String label;

    private OperationTypeEnum(final int value, final String label) {
        this.value = value;
        this.label = label;
    }

    @Override
    public int getValue() {
        return this.value;
    }

    @Override
    public String getLabel() {
        return this.label;
    }

    public static OperationTypeEnum parse(final int value) {
        OperationTypeEnum result = null;
        switch (value) {
        case 1:
            result = OperationTypeEnum.add;
            break;
        case 2:
            result = OperationTypeEnum.update;
            break;
        case 3:
            result = OperationTypeEnum.delete;
            break;

        }
        return result;
    }

    public static List<OperationTypeEnum> getEnumValues() {
        return Arrays.asList(OperationTypeEnum.values());
    }

}
